﻿package  
{
	import com.saint.utils.Logger;	
	import flash.display.BitmapData;
	import flash.display.BitmapDataChannel;
	import flash.display.Loader;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import flash.filters.DisplacementMapFilter;
	import flash.geom.Point;
	import flash.net.URLRequest;
	
	/**
	 * ...
	 * @author kembera
	 */
	public class Main
	{
		private var checkBitmap:BitmapData;
		private var displacementMap:DisplacementMapFilter
		
		public function Main() 
		{
			Logger.info("Main.Main");
			
			checkBitmap = new CheckBitmap(0,0);

			var filterMC:Sprite = new RedCirlceRad();
			var mapBitmap:BitmapData = new BitmapData(filterMC.width, filterMC.height, true, 0);
			mapBitmap.draw(filterMC);
				
			// Create the displacement map image.
			var mapImage:BitmapData = new BitmapData(checkBitmap.width, checkBitmap.height, false, 0xFF0000);
			
			// Create the displacement filter.
			displacementMap = new DisplacementMapFilter();
			displacementMap.mapBitmap = mapImage;
			displacementMap.mapPoint = new Point(0, 0);
			displacementMap.componentX = BitmapDataChannel.RED;
			displacementMap.scaleX = 250;
			loader.filters = [displacementMap];
		}

		
	}

}